<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

return new class extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('quality_inspects', function (Blueprint $table) {
            $table->id();
            $table->unsignedBigInteger('project_id')->index()->comment('所属项目ID');
            $table->unsignedBigInteger('quality_id')->index()->comment('质量检查ID');
            $table->unsignedBigInteger('person_id')->default(0)->comment('责任人');
            $table->tinyInteger('type')->index()->comment('1:正常，2:整改');
            $table->string('content')->nullable('')->comment('检查内容');
            $table->unsignedBigInteger('days')->default(0)->comment('期限天');
            $table->date('correction_date')->nullable()->comment('整改日期');
            $table->string('images')->nullable()->comment('协调内容');
            $table->unsignedBigInteger('correction_id')->default(0)->comment('整改人');
            $table->timestamps();
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('quality_inspects');
    }
};
